﻿<phone:PhoneApplicationPage 
    x:Class="XMPPClient.FileTransferPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="PageTitle" Text="File Transfers" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ListBox x:Name="ListBoxFileTransfers">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="70" />
                                <ColumnDefinition Width="400*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>

                            <Image Grid.RowSpan="1" Grid.Column="0" Grid.Row="0" Width="32" Height="32" Source="Images/File.png" />
                            
                            <TextBlock Grid.Column="1" Grid.Row="0"  Text="{Binding StringValue}" TextWrapping="Wrap" />
                            <ProgressBar Grid.Column="1" Grid.Row="1" Height="30"  Value="{Binding PercentTransferred}" Maximum="100" />

                            <!--Accept or Cancel, only visible for incoming request-->
                            <StackPanel Grid.Column="1" Visibility="{Binding IsVisibleSendCancel, Mode=OneWay}" Grid.Row="2"  Orientation="Horizontal">
                                <Button x:Name="ButtonCancelSend" Click="ButtonCancelSend_Click">Cancel</Button>
                            </StackPanel>
                            <StackPanel Grid.Column="1" Grid.Row="2"  Orientation="Horizontal">
                                <Button Margin="5,0" Visibility="{Binding IsAcceptCancelVisible, Mode=OneWay}" x:Name="ButtonAcceptTransfer" Click="ButtonAcceptTransfer_Click">Accept</Button>
                                <Button Margin="5,0" Visibility="{Binding IsAcceptCancelVisible, Mode=OneWay}" x:Name="ButtonDeclineTransfer" Click="ButtonDeclineTransfer_Click">Decline</Button>
                                <Button Margin="5,0" Visibility="{Binding IsSaveVisible, Mode=OneWay}" x:Name="ButtonSaveFile" Click="ButtonSaveFile_Click"  Content="Save" />
                                <!--<Button Margin="5,0" Visibility="{Binding IsSaveVisible, Mode=OneWay}" x:Name="ButtonOpenFile" Click="ButtonOpenFile_Click"  Content="Open" />-->
                            </StackPanel>

                        </Grid>
                        
                        
                    </DataTemplate>
                </ListBox.ItemTemplate>
                
            </ListBox>
        </Grid>
    </Grid>
 

</phone:PhoneApplicationPage>
